package com.aloda.ojquestion.controller.inner;

import com.aloda.ojcommon.domain.entity.QuestionSubmit;
import com.aloda.ojquestion.service.QuestionSubmitService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * @Author aloda
 * @Date 2025/4/29 14:11
 */
@Slf4j
@RestController
@RequestMapping("/question/submit/inner")
public class QuestionSubmitInnerController {

    @Resource
    private QuestionSubmitService questionSubmitService;

    /**
     * 通过id获取答题记录
     *
     * @param id
     * @return
     */
    @GetMapping("/{id}")
    public QuestionSubmit getById(@PathVariable Long id) {
        return questionSubmitService.getById(id);
    }

    @PutMapping
    public boolean update(@RequestBody QuestionSubmit questionSubmit) {
        return questionSubmitService.updateById(questionSubmit);
    }
}
